home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6125 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  536 b 

  1. From: Tendrils@msn.com (kelvin  )
  2. Subject: RE: Memory allocation.
  3. Date: 11 Feb 96 07:38:02 -0800
  4. References: <1996Feb10.161530.26449@wisipc.weizmann.ac.il>
  5. Message-ID: <00001a81+00009e86@msn.com>
  6. Path: news.msn.com!msn.com
  7. Newsgroups: comp.lang.c++
  8. Organization: The Microsoft Network (msn.com)
  9.  
  10. The program may or may not works...
  11. try adding another function call in main()...before cout.
  12.  
  13. e.g.
  14.  
  15. int func2(int input)
  16. {
  17.     return input;
  18. }
  19.  
  20. int
  21. main()
  22. {
  23.     int* x=func();
  24.  
  25.     int y=func2(22); // add this!!!
  26.  
  27.     cout<<x[2]<<endl;
  28.  
  29.     return(1);
  30. }
  31.